package com.example.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@ApiModel("用户实体类")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class User {
    @ApiModelProperty("主键自增，不用给值")
    private int userID;
    @ApiModelProperty("用户账号名称，字符串类型")
    @NotEmpty(message = "用户名不能为空")
    private String username;
    @ApiModelProperty("用户手机号码,正常手机号长度，第2位不能是2")
    @NotEmpty(message = "手机号不能为空")
    private String phoneNumber;
    @ApiModelProperty("用户性别，1-男，2-女")
    private Short gender;
    @ApiModelProperty("用户账号密码")
    @NotEmpty(message = "密码不能为空")
    private String password;
    @ApiModelProperty("用户真实姓名")
    @NotEmpty(message = "真实姓名不能为空")
    private String name;
    @ApiModelProperty("用户身份证号,一共18位数字，最后一位可以是x")
    @NotEmpty(message = "身份证号不能为空")
    private String idNumber;
    @ApiModelProperty("用户类型 1-注册用户 2-管理员用户")
    private Short userType;
    @ApiModelProperty("用户注册账号的时刻")
    private LocalDateTime createTime; //创建时间
    @ApiModelProperty("用户信息最后一次修改的时间")
    private LocalDateTime updateTime; //修改时间
    @ApiModelProperty(value = "验证码")
    private String code;
    @ApiModelProperty(value = "盐")
    private String salt;
    @ApiModelProperty(value = "动态值")
    private String iv;

}
